#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
using namespace std;


int main()
{
    long long n = 0, k = 0, tmp = 0, sum = 0, top = 0;
    cin >> n >> k;
    priority_queue<int, vector<int>, less<int>> pq;
    for (int i = 0; i < n; i++)
    {
        cin >> tmp;
        if (tmp % 2 == 0) pq.push(tmp);
        sum += tmp;
    }
    while (k && !pq.empty())
    {
        top = pq.top();
       
        if ((top / 2) % 2 == 0)
        {
            pq.push(top / 2);

        }
        sum -= top / 2;
        pq.pop();
        k--;
    }
    cout << sum;
    return  0;
}